package com.example.springbootdisconf.config;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import org.springframework.context.annotation.Configuration;

@Configuration//这里使用什么注解无所谓，只要能注入就可以
@DisconfFile(filename = "redis.properties")
public class RedisConfig {
    private String host;
    private int port;

    @DisconfFileItem(name = "redis.host")
    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    @DisconfFileItem(name = "redis.port")
    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }
}
